﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using bdxyit.com.RecruitmentAppSys.IDAL;
using bdxyit.com.RecruitmentAppSys.DALFactory;
using bdxyit.com.RecruitmentAppSys.Models;
using bdxyit.com.RecruitmentAppSys.ViewModels;

namespace bdxyit.com.RecruitmentAppSys.BLL
{
    public class ApplyJobActionBLL
    {
        private static readonly IApplyJobActionDAL ApplyJobActionDal = DataAccess.CreateApplyJobAction();

        /// <summary>
        /// 获取应聘职位
        /// </summary>
        /// <returns></returns>
        public static List<ApplyJobAction> GetAllApplyJobActionByUserId(string userId) 
        {
            return ApplyJobActionDal.SelectApplyJobActionByUserId(userId);
        }

        /// <summary>
        /// 获取应聘职位
        /// </summary>
        /// <returns></returns>
        public static ApplyJobAction GetApplyJobActionByUserIdAndFlag(string userId,int flag)
        {
            return ApplyJobActionDal.SelectApplyJobActionByUserIdAndFlag(userId, flag);
        }

        /// <summary>
        /// 删除应聘职位
        /// </summary>
        /// <returns></returns>
        public static bool RemoveApplyJobActionByUserIdAndFlag(string userId, int flag) 
        {
            return ApplyJobActionDal.DeleteApplyJobActionByUserIdAndFlag(userId, flag);
        }

        /// <summary>
        /// 删除应聘职位
        /// </summary>
        /// <returns></returns>
        public static bool RemoveApplyJobActionByUserId(string userId)
        {
            return ApplyJobActionDal.DeleteApplyJobActionByUserId(userId);
        }


        /// <summary>
        /// 创建应聘职位
        /// </summary>
        /// <returns></returns>
        public static bool CreateApplyJobAction(ApplyJobAction aja) 
        {
            return ApplyJobActionDal.InsertApplyJobAction(aja);
        }


        /// <summary>
        /// 编辑应聘职位
        /// </summary>
        /// <returns></returns>
        public static bool EditApplyJobAction(ApplyJobAction aja) 
        {
            return ApplyJobActionDal.UpdateApplyJobAction(aja);
        }
    }
}
